/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hu
 * Date: 2024-04-25
 * Time: 15:30
 */
public class Tesy {
    public static void main(String[] args) {
        int num = 1;
        int sum = 0;
        //外层循环负责求各阶层的和
        while(num <= 5){
            int n = 1;
            int tmp = 1;
            //内层循环负责求各个数的阶层
            while(tmp <= num){
                n *= tmp;
                tmp++;
            }
            sum += n;
            num++;
        }
        System.out.println(sum);
    }
    public static void main1(String[] args) {
        int num = 1;
        int result = 1;
        while(num <=5 ){
            result *= num;
            num++;
        }
        System.out.println(result);
    }
}
